from pathlib import Path
def configextractor(root: str, config: str | None):
    _root = Path(root)
    settings_yaml = (
        Path(config)
        if config and Path(config).suffix in [".yaml", ".yml"]
        else _root / "settings.yaml"
    )
    with settings_yaml.open("rb") as file:
        import yaml
        data = yaml.safe_load(file.read().decode(encoding="utf-8", errors="strict"))
    return data

    #config_data = configextractor(root=root, config=config)
    #print(config_data['llm']['model'])